{% load staticfiles %}
<!-- 头部导航栏 -->
<header class="main-header">

    <!-- Logo -->
    <a href="#" class="logo">
        <!-- mini logo for sidebar mini 50x50 pixels -->
        <span class="logo-mini"><b>V</b>PN</span>
        <!-- logo for regular state and mobile devices -->
        <span class="logo-lg"><b>VPN</b>后台管理系统</span>
    </a>

    <!-- Header Navbar -->
    <nav class="navbar navbar-static-top" role="navigation">
        <!-- Sidebar toggle button-->
        <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
            <span class="sr-only">Toggle navigation</span>
        </a>
        <!-- Navbar Right Menu -->
        <div class="navbar-custom-menu">
            <ul class="nav navbar-nav">
                <!-- 顶部右侧用户信息菜单 -->
                <li class="dropdown user user-menu">
                    <!-- Menu Toggle Button -->
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                        <!-- The user image in the navbar-->
                        <img src="{% static 'images/default.jpg' %}" class="user-image" alt="User Image">
                        <!-- hidden-xs hides the username on small devices so only the image appears. -->
                        <span class="hidden-xs">{{ request.user.username }}</span>
                    </a>
                    <ul class="dropdown-menu">
                        <!-- The user image in the menu -->
                        <li class="user-header">
                            <img src="{% static 'images/default.jpg' %}" class="img-circle" alt="User Image">

                            <p>
                                {{ request.user.username }}
                                <small>{{ request.user.email }}</small>
                            </p>
                        </li>

                        <!-- Menu Footer-->
                        <li class="user-footer">
                            <div class="pull-left">
                                {#                                <a href="{% url 'profile' %}" class="btn btn-default btn-flat">个人中心</a>#}
                            </div>
                            <div class="pull-right">
                                <a href="{% url 'logout' %}" class="btn btn-default btn-flat">退出登录</a>
                            </div>
                        </li>
                    </ul>
                </li>
            </ul>
        </div>

        {% for menu in request.top_menu %}
            <ul class="nav navbar-nav">
                <li {% ifequal menu.status True %}class="active" {% endifequal %}>
                    <a href="{{ menu.url }}" id="{{ menu.code }}">{{ menu.name | default_if_none:"" }}</a>
                </li>
            </ul>
        {% endfor %}
    </nav>
</header>